<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8" />
		<title>售后服务详情-{eyou:global name='web_name' /}</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
		<link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
		{eyou:static file="users/skin/css/bootstrap.min.css" /}
	    {eyou:static file="users/skin/css/basic.css" /}
	    {eyou:static file="users/skin/css/eyoucms.css" /}
	    {eyou:static file="users/skin/css/shop.css" /}
		<!-- 新样式 2020-12-8 -->
		{eyou:static file="users/skin/css/element/index.css" /}
		{eyou:static file="users/skin/css/e-user.css" /}
	    {eyou:include file="users/skin/css/diy_css.htm"/}

		{eyou:static file="/public/static/common/js/jquery.min.js"/}
	    {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
	    {eyou:static file="/public/static/common/js/tag_global.js"/}
    	{eyou:static file="/public/plugins/laydate/laydate.js"/}
	</head>

	<body>
		<!-- 头部信息 -->
		<div class="ey-header-status">
			<div class="header-status-l">
				<a href="javascript:history.go(-1)"><i class="el-icon-arrow-left"></i></a>
			</div> 
			<div class="header-status-m">售后服务详情</div> 
			<div class="header-status-r">
				<a href="{eyou:url link='user/Users/index' /}"><i class="el-icon-user"></i></a>
			</div>
		</div>
		<!-- 头部信息结束 -->

		<div class="h50"></div>
		<div class="ey-container">
			<div class="el-row">
				{eyou:eq name="$eyou.field.status" value="6"}
					<div class="el-row p10 bgfff mt10">
						<div class="column-title"> <div class="column-title-l">商家发货物流</div> </div>
						<div class="order-progress-con">
							<div class="span-row">
								<div class="span-row-l"> 温馨提示： </div>
								<div class="span-row-r" style="color: red;">卖家已为你重新发货，详情如下</div>
							</div>
							<div class="span-row">
								<div class="span-row-l"> 快递公司： </div>
								<div class="span-row-r"> {$eyou.field.admin_delivery.name} </div>
							</div>
							<div class="span-row">
								<div class="span-row-l"> 快递单号： </div>
								<div class="span-row-r"> {$eyou.field.admin_delivery.code} </div>
							</div>
						</div>
					</div>
                {/eyou:eq}

				{eyou:eq name="$eyou.field.status" value="2"}
					<div class="el-row p10 bgfff mt10">
						<div class="column-title"> <div class="column-title-l"> 会员退货信息 </div> </div>
						<form id="postForm">
							<input type="hidden" name="service_id" value="{$eyou.field.service_id}">
	                        <input type="hidden" name="order_id" value="{$eyou.field.order_id}">
	                        <input type="hidden" name="status" value="4">
							<div class="order-progress-con">
								<div class="span-row">
									<div class="span-row-l" style="line-height: 35px; height: 35px;"> 快递公司：</div>
									<div class="span-row-r">
										<input type="text" name="delivery[name]" class="el-input__inner w200" placeholder="请输入快递公司">
									</div>
								</div>
								<div class="span-row">
									<div class="span-row-l" style="line-height: 35px; height: 35px;"> 快递费用：</div>
									<div class="span-row-r">
										<input type="text" name="delivery[cost]" class="el-input__inner w200" placeholder="请输入快递费用">
									</div>
								</div>
								<div class="span-row">
									<div class="span-row-l" style="line-height: 35px; height: 35px;"> 快递单号：</div>
									<div class="span-row-r">
										<input type="text" name="delivery[code]" class="el-input__inner w200" placeholder="请输入快递单号">
									</div>
								</div>
								<div class="span-row">
									<div class="span-row-l" style="line-height: 35px; height: 35px;"> 发货时间：</div>
									<div class="span-row-r">
										<input type="text" name="delivery[time]" id="add_time" class="el-input__inner w200" placeholder="请输入选择发货时间">
									</div>
								</div>
	                        	<div class="span-row">
	                                <div class="span-row-l"> 联系人：</div>
	                                <div class="span-row-r"> {$eyou.maddr.addr_contact_person} </div>
	                            </div>
	                            <div class="span-row">
	                                <div class="span-row-l"> 联系号码：</div>
	                                <div class="span-row-r"> {$eyou.maddr.addr_contact_phone} </div>
	                            </div>
	                            <div class="span-row">
	                                <div class="span-row-l"> 商家地址：</div>
	                                <div class="span-row-r"> {$eyou.maddr.addr_shipping_addr} </div>
	                            </div>
	                            <div class="span-row">
	                                <div class="span-row-l"> 提示：</div>
	                                <div class="span-row-r"> <span style="color: red;">{$eyou.field.service_type}申请已审核通过，请尽快将货物寄回给卖家</span> </div>
	                            </div>
	                            <div class="span-row">
	                                <div class="span-row-l"></div>
	                                <div class="span-row-r"> <a href="JavaScript:void(0);" class="el-button el-button--primary el-button--medium" data-url="{$eyou.ServiceUrl}" onclick="Submit(this);" style="color: red;">确认提交</a> </div>
	                            </div>
							</div>
						</form>
					</div>
					<script type="text/javascript">
                        $(function () {
                            $('#add_time').layDate(); 
                        });
                        function Submit(obj) {
						    var name = $("input[name='delivery[name]']");
						    if (!name.val()) {
						        layer.msg('请填写快递公司');
						        name.focus();
						        return false;
						    }
						    // var cost = $("input[name='delivery[cost]']");
						    // if (!cost.val()) {
						    //     layer.msg('请填写快递费用');
						    //     cost.focus();
						    //     return false;
						    // }
						    var code = $("input[name='delivery[code]']");
						    if (!code.val()) {
						        layer.msg('请填写快递单号');
						        code.focus();
						        return false;
						    }
						    var time = $("input[name='delivery[time]']");
						    if (!time.val()) {
						        $('#add_time').click();
						        return false;
						    }
						    $.ajax({
						        url: $(obj).data('url'),
						        data: $('#postForm').serialize(),
						        type:'post',
						        dataType:'json',
						        success:function(res) {
						            layer.closeAll();
						            if (1 == res.code) {
						                layer.msg(res.msg, {time: 1500}, function(){
						                    window.location.reload();
						                });
						            } else {
						                layer.msg(res.msg);
						            }
						        },
						        error : function() {
						            layer.closeAll();
						            layer.alert('未知错误！', {title:false, icon:5, closeBtn: 0});
						        }
						    });
						}
                    </script>
				{/eyou:eq}

			    <div class="el-row p10 bgfff mt10">
					<div class="column-title">
						<div class="column-title-l">售后服务信息</div> 
						<div class="column-title-r">
							{eyou:if condition="!in_array($eyou.field.status, $eyou.StatusArr)"}
								<span class="el-tag el-tag--danger el-tag--light">
									<a href="JavaScript:void(0);" data-url="{$eyou.field.CancelUrl}" data-id="{$eyou.field.service_id}" onclick="CancelService(this);">取消服务</a>
								</span>
							{/eyou:if}
						</div> 
					</div>
					<div class="order-progress-con">
						<div class="span-row">
							<div class="span-row-l">申请单号：</div>
							<div class="span-row-r">{$eyou.field.refund_code}</div>
						</div>
						<div class="span-row">
							<div class="span-row-l">申请类型：</div>
							<div class="span-row-r">{$eyou.field.service_type}</div>
						</div>
						<div class="span-row">
							<div class="span-row-l">申请时间：</div>
							<div class="span-row-r">{$eyou.field.add_time|date='Y-m-d H:i:s',###}</div>
						</div>
						<div class="span-row">
							<div class="span-row-l">当前状态：</div>
							<div class="span-row-r">{$eyou.field.StatusName}</div>
						</div>
						<div class="span-row"></div>

						<div class="span-row">
							<div class="span-row-l">您的姓名：</div>
							<div class="span-row-r">{$eyou.field.consignee}</div>
						</div>
						<div class="span-row">
							<div class="span-row-l">您的手机：</div>
							<div class="span-row-r">{$eyou.field.mobile}</div>
						</div>
						<div class="span-row">
							<div class="span-row-l">收货地址：</div>
							<div class="span-row-r">{$eyou.field.address}</div>
						</div>
						<div class="span-row"></div>

						<div class="span-row">
							<div class="span-row-l">问题描述：</div>
							<div class="span-row-r">{$eyou.field.content}</div>
						</div>
						<div class="span-row">
							<div class="span-row-l"></div>
							<div class="span-row-r">
								{eyou:volist name='$eyou.field.upload_img' id='vo'}
		                            {eyou:notempty name="$vo"}
		                                <a href="{$vo}" target="_blank"><img src="{$vo}" width="80" height="80"/></a>
		                            {/eyou:notempty}
		                        {/eyou:volist}
							</div>
						</div>
					</div>
				</div>
				
				<div class="el-row p10 bgfff mt10">
					<div class="column-title">
						<div class="column-title-l">售后商品信息</div> 
						<div class="column-title-r"></div> 
					</div>
					<div class="mt20 mb10 order-goods goods-con">
						<div class="goods-item">
							<div class="item-main">
								<!-- 获取订单商品 -->
								<div class="item-con">
									<div class="item-con-l">
										<a href="{$eyou.field.arcurl}"><img src="{$eyou.field.product_img}"></a>
									</div>
									<div class="item-con-m">
										<a href="{$eyou.field.arcurl}"> {$eyou.field.product_name} </a>
										<div class="info mt5"> {$eyou.field.product_spec} </div>
									</div>
									<div class="item-con-r">
										<span class="price_flag">￥</span><span>{$eyou.field.refund_price}</span>
										<p class="number">x{$eyou.field.product_num}</p>
										{eq name="$eyou.field.service_type_old" value="2"}
										<span class="price_flag">退还余额：{$eyou.field.refund_total_price}(减<span style="color: red;">{$eyou.field.ShippingFee}</span>运费)</span>
										{/eq}
									</div>
								</div>
							</div>
						</div>
					</div>		
				</div>
				
				<div class="el-row p10 bgfff mt10 mb10">
					<div class="column-title">
						<div class="column-title-l">售后服务流程</div> 
						<div class="column-title-r"></div> 
					</div>
					<div> &nbsp; </div>
					{eyou:volist name="$eyou.StatusLog" id="vo"}
						<div class="order-progress-con" style="background-color: #fef0f0; border-color: #fde2e2;">
							<div class="span-row">
								<div class="span-row-l">操作者：</div>
								<div class="span-row-r">{$vo.name}</div>
							</div>
							<div class="span-row">
								<div class="span-row-l">操作时间：</div>
								<div class="span-row-r">{$vo.add_time|date='Y-m-d H:i:s',###}</div>
							</div>
							<div class="span-row">
								<div class="span-row-l">操作备注：</div>
								<div class="span-row-r">{$vo.log_note}</div>
							</div>
						</div>
						<div> &nbsp; </div>
	                {/eyou:volist}
				</div>
			</div>
		</div>
	</body>
</html>
<script type="text/javascript">
    // 取消服务单
    function CancelService(obj) {
        layer.confirm('确定要取消服务单？', {
            btn: ['确认', '取消'],
            title: false,
            closeBtn: 0
        }, function () {
            $.ajax({
                url: $(obj).data('url'),
                data: {service_id: $(obj).data('id')},
                type:'post',
                dataType:'json',
                success:function(res) {
                    layer.closeAll();
                    if (1 == res.code) {
                    	layer.msg(res.msg, {time: 1500},function(){
	                        location.reload();
	                    });
                    } else {
                        layer.msg(res.msg, {time: 2000});
                    }
                },
                error : function() {
                    layer.closeAll();
                    layer.alert('未知错误，无法继续！', {title: false, closeBtn: 0, icon: 5});
                }
            });
        });
    }
</script>